<!DOCTYPE html>
<html>
<head>
<!--
  Copyright (c) 2015-2018 Jean-Marc VIGLINO,
  released under CeCILL-B (french BSD like) licence: http://www.cecill.info/
-->
  <title>ol-ext: style chart</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta name="description" content="ol.style.Chart is an image style to draw statistical graphics (bar or pie charts) on a map." />
  <meta name="keywords" content="ol3, style, vector, statistic, chart, pie, animation" />
  
  <!-- jQuery -->
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>

  <!-- Openlayers -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@latest/ol.css" />
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ol@latest/dist/ol.js"></script>


  <!-- ol-ext -->
  <link rel="stylesheet" href="../../dist/ol-ext.css" />
  <script type="text/javascript" src="../../dist/ol-ext.js"></script>
  <!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
  <script src="https://unpkg.com/elm-pep"></script>


  <link rel="stylesheet" href="../style.css" />

  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css" />
  <script type="text/javascript" src="../../dist/extra/FontAwesome5Def.js"></script>
  
  <!--
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <script type="text/javascript" src="../../dist/extra/FontAwesomeDef.js"></script>
  -->

</head>
<body >

  <h1>ol-ext FontAwesome v5.15.3</h1>
  <!-- Map div -->
  <div id="map" style="width:600px; height:400px;"></div>

  <i class="fa fa-wheelchair" style="font-size:2em"></i>

<script>
  var map = new ol.Map({
    target: 'map',
    view: new ol.View({ zoom: 5, center: [166326, 5992663] }),
    layers: [	new ol.layer.Tile({ source: new ol.source.OSM() }) ]
  });

  // Set FontAwesome package here
  var glyph;
  var stylefn = function() {
    glyph = new ol.style.FontSymbol({
      glyph: "fa-wheelchair",
      fontStyle: 'bold',
      form: 'circle',
      radius: 20, 
      fill: new ol.style.Fill({
        color: "#369"
      }),
      stroke: new ol.style.Stroke({
        color: "#fff",
        width: 2
      })
    });
    return new ol.style.Style({
      image: glyph
    });
  };

  // Vector layer
  var vector = new ol.layer.Vector({ 
    source: new ol.source.Vector(),
    style: stylefn
  });
  var pt = new ol.Feature(new ol.geom.Point([259274, 6398696]));
  vector.getSource().addFeature(pt);


  map.addLayer(vector);
</script>
</body>